package cn.zysuyuan.item.service.impl;

import cn.zysuyuan.common.entity.PageResult;
import cn.zysuyuan.common.utils.UUIDUtil;
import cn.zysuyuan.item.entity.ProductbaseMedicinalGone;
import cn.zysuyuan.item.mapper.ProductbaseMedicinalGoneMapper;
import cn.zysuyuan.item.service.ProductbaseMedicinalGoneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author flypig
 * @version 1.0
 * @date 2020-02-12 9:01
 */

@Service
public class ProductbaseMedicinalGoneServiceImpl implements ProductbaseMedicinalGoneService {

    @Autowired
    private ProductbaseMedicinalGoneMapper productbaseMedicinalGoneMapper;


    @Override
    public PageResult<ProductbaseMedicinalGone> selectList(Map<String, Object> map) {
        List<ProductbaseMedicinalGone> listTBH = productbaseMedicinalGoneMapper.selectList(map);
        return new PageResult<ProductbaseMedicinalGone>(listTBH);
    }

    @Override
    public int insert(ProductbaseMedicinalGone productbaseMedicinalGone) {
        productbaseMedicinalGone.setId(UUIDUtil.uuid());
        productbaseMedicinalGone.setgCreateTime(new Date());
        return productbaseMedicinalGoneMapper.insert(productbaseMedicinalGone);
    }

    @Override
    public int delete(String id) {
        return productbaseMedicinalGoneMapper.delete(id);
    }

    @Override
    public int update(ProductbaseMedicinalGone productbaseMedicinalGone) {
        return productbaseMedicinalGoneMapper.update(productbaseMedicinalGone);
    }
}
